# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=creepy
pkgver=137.9f60449
pkgrel=5
epoch=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-social' 'blackarch-recon')
pkgdesc='A geolocation information gatherer. Offers geolocation information gathering through social networking platforms.'
arch=('any')
url='http://github.com/ilektrojohn/creepy.git'
license=('GPL3')
provides=('creepy')
makedepends=('git')
depends=('python2' 'python2-tweepy' 'python2-osmgpsmap' 'python2-flickrapi'
         'python2-beautifulsoup3' 'python2-exiv2' 'python2-configobj'
         'python2-simplejson' 'python2-yapsy' 'python2-pyqt4' 'pyqt4-common')
source=("git+https://github.com/ilektrojohn/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/doc/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README.md LICENSE

  cp -a creepy/* "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python2 "/usr/share/$pkgname/CreepyMain.py" "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

